import request from '@/utils/request.js'
// 获取图形验证码
export const getPic = () => request('/captcha/image')

// 获取短信验证码
export const getCode = (captchaCode, captchaKey, mobile) => {
  return request({
    url: '/captcha/sendSmsCaptcha',
    method: 'POST',
    headers: {
      platform: 'H5'
    },
    data: {
      form: {
        captchaCode,
        captchaKey,
        mobile
      }
    }
  })
}

// 登录请求
export const login = (mobile, smsCode) => {
  return request({
    url: '/passport/login',
    method: 'POST',
    headers: {
      platform: 'H5'
    },
    data: {
      form: {
        isParty: false,
        partyData: {},
        mobile,
        smsCode
      }
    }
  })
}
